package 线程.zuoye;

public class zuoye1 implements Runnable {
    int shijian;
    int sudu;
    int putong=50;
    int texu=10;

    public zuoye1(int shijian, int sudu) {
        this.shijian = shijian;
        this.sudu = sudu;
    }



    @Override
    public void run() {
        for (int i=1;i<=sudu;i++){
            try {
                Thread.sleep(shijian*1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (Thread.currentThread().getName().equals("普通号")){
                if (i==10){
                    try {
                        Thread.currentThread().join();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
            System.out.println(Thread.currentThread().getName() + "看了"+i+"个");
        }
    }
   public static void sleep(long millis){
        millis=10;
    }
}
